package work.xiaohong.mybatisplus.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import work.xiaohong.mybatisplus.vo.SUserDeptVo;
import work.xiaohong.mybatisplus.entity.SUser;

import java.util.List;

/**
 * 用户表 Mapper 接口
 * @author xiaohong
 * @since 2021-10-22 10:10:22
 */
@DS("slave_1")
public interface SUserMapper extends BaseMapper<SUser> {

    /**
     * 连表查询SUser和Dept
     * @return
     */
//    @Select("SELECT s.*,d.`name`,d.pid,d.tips FROM `s_user` s LEFT JOIN dept d on s.dept_id = d.id")
    List<SUserDeptVo> findAllUserAndDept();
}
